package com.sky.mapper;

import com.sky.entity.AddressBook;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: sky-take-out
 * @description:
 * @author: fmp
 * @create: 2023-04-09 15:10
 * @Version 1.0
 **/
@Mapper
public interface AddressBookMapper {
    //查询当前用户下的全部地址
    List<AddressBook> selectAllAddressBookByUserId(@Param("userId") Long userId);
    //新增地址
    void insertAddressBook(@Param("addressBook") AddressBook addressBook);
    //根据id查询
    AddressBook selectById(@Param("id") Long id);
    //根据id修改地址
    void UpdateAddressBook(@Param("addressBook") AddressBook addressBook);
    //很根据id删除
    void DeleteAddressBookById(@Param("id") Long id);
    //设置默认地址
    void SetDefaultAddressBook(@Param("addressBook") AddressBook addressBook);
    //全部设置为0
    void SetDefault(@Param("UserID") Long UserID);
}
